#解决重复问题的
# 1.if n==0 终止条件
# 2.n -- m m = n-1
def factorial(n):
    if n ==0:
        return 1
    return n*factorial(n-1)
print(factorial(10))

def hanoi(n,source,center,destination):
# 2.判断终止条件
    if n == 1:
        print("第一块{}移动到{}".format(source,destination))
        return
    hanoi(n-1,source,destination,center)
    print("将第{}块从{}移动到{}".format(n,source,destination))
    hanoi(n-1,center,source,destination)

hanoi(3,"A","B","C")




#
def fib(n):
    if n == 0:
        return 0
    if n == 1:
        return 1
    return fib(n-1)+fib(n-2)
for i in range(1,10):
    print(fib(i),end=",")
print()
print(fib(8))